package com.qfedu.service.impl;

import com.github.pagehelper.PageInfo;
import com.qfedu.dao.CityExpandDao;
import com.qfedu.dao.RegionDao;
import com.qfedu.dao.RouteinfoDao;
import com.qfedu.entity.Cityexpand;
import com.qfedu.service.RouteService;
import com.qfedu.util.Result;
import com.qfedu.util.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * projectName: logistics
 *
 * @author: CGY
 * time: 2020-10-7 11:19
 * description:
 */
@Service
public class RouteServiceImpl implements RouteService {

    @Autowired
    private RegionDao regionDao;

    @Autowired
    private CityExpandDao cityExpandDao;

    @Autowired
    private RouteinfoDao routeinfoDao;

    @Override
    public Result findAllRegions() {
       return ResultUtil.getObject(regionDao.findAll(),"查询失败");
    }

    @Override
    public PageInfo findAllExpands() {
        List<Cityexpand> list = cityExpandDao.findAll();
        return new PageInfo(list);

    }

    @Override
    public Result findAllRoutes() {
        return ResultUtil.getObject(routeinfoDao.findAll(),"查询失败");
    }
}
